import { Copy } from 'lucide-react'

import { Button } from '@/components/ui/button'
import {
  Dialog,
  DialogClose,
  DialogContent,
  DialogDescription,
  DialogFooter,
  DialogHeader,
  DialogTitle,
} from '@/components/ui/dialog'
import { useRouter } from 'next/navigation'

export default function UpgradeDialog({ open, setOpen, title }) {
  const router = useRouter()

  return (
    <Dialog open={open} onOpenChange={setOpen}>
      <DialogContent className="sm:max-w-md">
        <DialogHeader>
          <DialogTitle>You have reached your {title} limit</DialogTitle>
          <DialogDescription>To continue, upgrade your plan</DialogDescription>
        </DialogHeader>
        <DialogFooter>
          <Button
            type="button"
            onClick={() => {
              setOpen(false)
              router.push('/billing')
            }}
          >
            Go to upgrade
          </Button>
        </DialogFooter>
      </DialogContent>
    </Dialog>
  )
}
